Skip to content

Add memory retention cleanup during consolidation#17

Open
coe0718 wants to merge 1 commit intoghostwright:mainfrom
coe0718:memory-retention-policy
Open

Add memory retention cleanup during consolidation#17
coe0718 wants to merge 1 commit intoghostwright:mainfrom
coe0718:memory-retention-policy

Conversation

@coe0718
Copy link
Copy Markdown
Contributor

@coe0718 coe0718 commented Mar 31, 2026

Part of #1.

What changed

  • add retention filter helpers plus Qdrant scroll support for cleanup queries
  • prune stale low-signal episodic memories after consolidation
  • prune long-expired superseded semantic facts after consolidation
  • document the retention step and cover it with focused memory tests

Why

The earlier memory PRs improved ranking, contradiction handling, and startup context, but stale memories were still only being down-ranked at retrieval time. This change adds the forgetting side of the system so low-value episodes and obsolete facts can age out during consolidation.

Validation

  • bun test src/memory/__tests__/episodic-retention.test.ts src/memory/__tests__/semantic-retention.test.ts src/memory/__tests__/consolidation.test.ts src/memory/__tests__/qdrant-client.test.ts
  • bun run typecheck
  • bun run lint
  • bun test

@coe0718 coe0718 marked this pull request as ready for review March 31, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant